package com.aliwo.design.patterns.FactoryMethod;

/**
 * @author xuyayuan
 * @description 工厂方法模式测试
 * @date 2021/9/8 15:36
 */
public class FactoryMethodTest {
    public static void main(String[] args) {
        try {
            TV tv;
            TVFactory tvFactory;
            // 获取子类工厂对象
            tvFactory = (TVFactory) XmlUtil.getBean();
            tv = tvFactory.produceTV();
            tv.play();
        } catch (Exception e) {
            System.out.println(e);
        }
    }
}
